home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: record
- Date: 30 Mar 1996 23:49:21 GMT
- Organization: Netcom
- Message-ID: <4jkha1$i4b@dfw-ixnews6.ix.netcom.com>
- References: <4jhr5v$6dg@news-e2b.gnn.com>
- NNTP-Posting-Host: den-co15-25.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Sat Mar 30 5:49:21 PM CST 1996
- X-Newsreader: WinVN 0.99.7
-
- In article <4jhr5v$6dg@news-e2b.gnn.com>, BMette@gnn.com says...
- >
- >How do I send a 'record' to a file?
- > I am using...
- >
- >struct application {...} app;
- >
- >and
- >
- >handle = open("DOA_APP.TXT", O_CREAT | O_RDWR | O_TEXT);
- > write(...);
- > ...
- > close(handle);
- >
- >but i want to just put it all at once...
- > if i cannot put it all at once how do i place line breaks
- >after each line?
-
-
- Try:
- write(handle, (void*)&app, sizeof(app));
-
- But hey! This is a C++ newsgroup! Use iostreams -- define your
- struct as a class and supply an operator << to dump it to a stream.
-
- john lilley
-
-
-
-
-